package com.study.dao.impl;

import com.study.dao.StudentDao;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import java.util.List;

public class StudentDaoImpl extends HibernateDaoSupport implements StudentDao {
    @Override
    public Student selectStudent(String readerId) {
        List list = this.getHibernateTemplate().find("from Student where readerId=?", readerId);
        Student student = null;
        if (list.size() > 0)
            student = (Student) list.get(0);
        return student;
    }
}

